package com.yachtar.property.db;

import android.content.ContentValues;
import android.database.Cursor;

import java.io.Serializable;

/**
 * ͶƱ�����
 * 
 * @author Administrator
 * 
 */
public class TUseHouse implements IBean, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * ����
	 */
	public final static String T_Name = "v_Fund_UseHouse_ForVote";
	/**
	 * ��Ŀ���---����Ŀ�����
	 */
	public final static String C_SERIALNO = "SERIALNO";
	/**
	 * ֤������
	 */
	public final static String C_CARDID = "CARDID";
	/**
	 * ҵ������
	 */
	public final static String C_OWNERNAME = "OWNERNAME";
	/**
	 * ���
	 */
	public final static String C_AREA = "AREA";
	/**
	 * ����¥�����
	 */
	public final static String C_BUILDINGID = "BUILDINGID";
	/**
	 * ���ڵ�Ԫ���
	 */
	public final static String C_CELLID = "CELLID";
	/**
	 * �Һ�
	 */
	public final static String C_ROOMNO = "ROOMNO";
	/**
	 * ����
	 */
	public final static String C_LOCATION = "LOCATION";

	/**
	 * ��̯ϵ��
	 */
	public final static String C_DEVERTRATE = "DEVERTRATE";
	/**
	 * �Ƿ���ͶƱ
	 */
	public final static String C_ISVOTED = "ISVOTED";
	/**
	 * ͶƱʱ��
	 */
	public final static String C_VOTEDATE = "VOTEDATE";
	/**
	 * ͶƱ���
	 */
	public final static String C_TICKETFLAG = "TICKETFLAG";
	/**
	 * �ֻ�����
	 */
	public final static String C_TELPHONE = "TELPHONE";
	/**
	 * Ψһ��
	 */
	public final static String C_GUID = "G_UID";

	public final static String[] tUseHouseCols = new String[] {
			TUseHouse.C_AREA, TUseHouse.C_BUILDINGID, TUseHouse.C_CARDID,
			TUseHouse.C_CELLID, TUseHouse.C_DEVERTRATE, TUseHouse.C_GUID,
			TUseHouse.C_ISVOTED, TUseHouse.C_LOCATION, TUseHouse.C_OWNERNAME,
			TUseHouse.C_ROOMNO, TUseHouse.C_SERIALNO, TUseHouse.C_TELPHONE,
			TUseHouse.C_TICKETFLAG, TUseHouse.C_VOTEDATE };

	/**
	 * ��Ŀ���---����Ŀ�����
	 */
	private String serialNO;
	/**
	 * ֤������
	 */
	private String cardId;
	/**
	 * ҵ������
	 */
	private String ownerName;
	/**
	 * ���
	 */
	private double area;
	/**
	 * ����¥�����
	 */
	private String buildingId;
	/**
	 * ���ڵ�Ԫ���
	 */
	private String cellId;
	/**
	 * �Һ�
	 */
	private String roomNO;
	/**
	 * ����
	 */
	private String location;
	/**
	 * ��̯���
	 */
	private int dever;
	/**
	 * ��̯ϵ��
	 */
	private double deverRate;
	/**
	 * �Ƿ���ͶƱ
	 */
	private String isVoted;
	/**
	 * ͶƱʱ��
	 */
	private String voteDate;
	/**
	 * ͶƱ���
	 */
	private String ticketFlag;
	/**
	 * �ֻ�����
	 */
	private String telephone;
	/**
	 * Ψһ��
	 */
	private String gUID;

	public String getSerialNO() {
		return serialNO;
	}

	public void setSerialNO(String serialNO) {
		this.serialNO = serialNO;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public double getArea() {
		return area;
	}

	public void setArea(double area) {
		this.area = area;
	}

	public String getBuildingId() {
		return buildingId;
	}

	public void setBuildingId(String buildingId) {
		this.buildingId = buildingId;
	}

	public String getCellId() {
		return cellId;
	}

	public void setCellId(String cellId) {
		this.cellId = cellId;
	}

	public String getRoomNO() {
		return roomNO;
	}

	public void setRoomNO(String roomNO) {
		this.roomNO = roomNO;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public int getDever() {
		return dever;
	}

	public void setDever(int dever) {
		this.dever = dever;
	}

	public double getDeverRate() {
		return deverRate;
	}

	public void setDeverRate(double deverRate) {
		this.deverRate = deverRate;
	}

	public String getIsVoted() {
		return isVoted;
	}

	public void setIsVoted(String isVoted) {
		this.isVoted = isVoted;
	}

	public String getVoteDate() {
		return voteDate;
	}

	public void setVoteDate(String voteDate) {
		this.voteDate = voteDate;
	}

	public String getTicketFlag() {
		return ticketFlag;
	}

	public void setTicketFlag(String ticketFlag) {
		this.ticketFlag = ticketFlag;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getgUID() {
		return gUID;
	}

	public void setgUID(String gUID) {
		this.gUID = gUID;
	}

	public void loadData(Cursor c) {
		if (c != null && !c.isAfterLast()) {
			this.buildingId = c.getString(c.getColumnIndex(C_BUILDINGID));
			this.cellId = c.getString(c.getColumnIndex(C_CELLID));
			this.area = c.getDouble(c.getColumnIndex(C_AREA));
			this.cardId = c.getString(c.getColumnIndex(C_CARDID));
			this.deverRate = c.getDouble(c.getColumnIndex(C_DEVERTRATE));
			this.gUID = c.getString(c.getColumnIndex(C_GUID));
			this.isVoted = c.getString(c.getColumnIndex(C_ISVOTED));
			this.location = c.getString(c.getColumnIndex(C_LOCATION));
			this.ownerName = c.getString(c.getColumnIndex(C_OWNERNAME));
			this.roomNO = c.getString(c.getColumnIndex(C_ROOMNO));
			this.serialNO = c.getString(c.getColumnIndex(C_SERIALNO));
			this.telephone = c.getString(c.getColumnIndex(C_TELPHONE));
			this.ticketFlag = c.getString(c.getColumnIndex(C_TICKETFLAG));
//			this.voteDate = new Date(c.getLong(c.getColumnIndex(C_VOTEDATE)));
			this.voteDate = c.getString(c.getColumnIndex(C_VOTEDATE));
		}
	}

	public ContentValues createContentValues() {
		ContentValues values = new ContentValues();
		values.put(C_BUILDINGID, this.buildingId);
		values.put(C_CELLID, this.cellId);
		values.put(C_AREA, this.area);
		values.put(C_TICKETFLAG, this.ticketFlag);
		values.put(C_CARDID, this.cardId);
		values.put(C_DEVERTRATE, this.deverRate);
		values.put(C_GUID, this.gUID);
		values.put(C_ISVOTED, this.isVoted);
		values.put(C_LOCATION, this.location);
		values.put(C_OWNERNAME, this.ownerName);
		values.put(C_ROOMNO, this.roomNO);
		values.put(C_SERIALNO, this.serialNO);
		values.put(C_TELPHONE, this.telephone);
//		values.put(C_VOTEDATE, this.voteDate.getTime());
		values.put(C_VOTEDATE, this.voteDate);
		return values;
	}

	@Override
	public void clearData() {
		// TODO Auto-generated method stub
		this.area = 0;
		this.buildingId = null;
		this.cardId = null;
		this.cellId = null;
		this.dever = 0;
		this.deverRate = 0;
		this.gUID = null;
		this.isVoted = null;
		this.location = null;
		this.ownerName = null;
		this.roomNO = null;
		this.serialNO = null;
		this.telephone = null;
		this.ticketFlag = null;
		this.voteDate = null;
	}

}
